﻿<!--
 * # 模块 HTML:
 *  Users - 用户管理
 *
 * # 描述:
 *  向系统管理人员提供用户的管理功能，包括为用户设置权限。
 *
 * Copyright (c), 上海沃恩信息科技有限公司.
 * All rights reserved.
 * Licensed under BSD (https://www.pittypat.work/bsd.html).
-->

<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <title>用户管理 | 组织与用户</title>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <meta name="author" content="上海沃恩信息科技有限公司" />

    <link rel="icon" type="image/png" href="../app.png" />

    <link rel="stylesheet" href="../../../../mdc/material-components-web.min.css" />
    <link rel="stylesheet" href="../../../../css/pittypat.css" />
    <style>
        .pt-main {
            padding-top: 0;
            padding-bottom: 4px;
        }

        .search-panel {
            display: flex;
            align-items: center;
        }

            .search-panel > .pt-fields {
                flex: 1 1 auto;
            }

        #search {
            flex: 0 0 auto;
        }

        #search,
        #load-more {
            background: none;
            border: none;
            padding: 0;
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .model-user > header > .pt-row-icon {
            position: relative;
        }

        .lock-indicator {
            position: absolute;
            left: 52px;
            top: 14px;
            height: 16px;
            width: 16px;
            font-size: 16px;
            color: #ff3d00;
            color: var(--mdc-theme-accent, #ff3d00);
            display: none;
        }

        .model-user-face {
            border-radius: 50%;
        }

        #loaded-summary {
            margin: 16px 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        #loaded-rows,
        #total-rows {
            color: rgba(0,0,0,0.54);
            color: var(--mdc-theme-text-secondary-on-light, rgba(0,0,0,0.54));
        }

            #loaded-rows::after {
                content: ' / ';
            }

        #set-face-dialog-body > * {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #set-face-dialog-body > header > img {
            width: 128px;
            height: 128px;
            border-radius: 50%;
            color: rgba(0,0,0,0.38);
            color: var(--mdc-theme-text-icon-on-background, rgba(0,0,0,0.38));
        }

        #set-face-select-file {
            margin: 16px 0;
        }
    </style>
</head>
<body class="pt-nav-pinned">
    <!-- 页眉 -->
    <header>
        <section class="pt-page-toolbar">
            <button class="pt-nav-toggle mdc-ripple-surface" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                <i class="material-icons">menu</i>
            </button>
            <h1 class="pt-page-title">用户管理</h1>
            <button class="mdc-ripple-surface" data-target-dialog="#add-dialog" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                <i class="material-icons">add</i>
            </button>
            <button class="pt-nc-toggle mdc-ripple-surface" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                <i class="material-icons">chat_bubble_outline</i>
                <b></b>
            </button>
            <button class="pt-page-menu-toggle mdc-ripple-surface" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                <i class="material-icons">more_vert</i>
            </button>
            <div class="pt-page-menu mdc-simple-menu mdc-simple-menu--open-from-top-right" tabindex="-1">
                <div class="mdc-simple-menu__items mdc-list" role="menu" aria-hidden="true">
                    <a class="mdc-list-item pt-page-refresh" role="menuitem" tabindex="0">
                        <i class="material-icons mdc-list-item__start-detail">refresh</i>
                        <span>刷新页面</span>
                    </a>
                    <div class="mdc-list-divider" role="separator"></div>
                    <a class="mdc-list-item" role="menuitem" tabindex="0" href="help/index.html" target="_blank">
                        <i class="material-icons mdc-list-item__start-detail">help_outline</i>
                        <span>查看帮助</span>
                    </a>
                    <div class="mdc-list-divider pt-page-menu-logout-divider" role="separator"></div>
                    <a class="mdc-list-item pt-page-menu-logout" role="menuitem">
                        <i class="material-icons mdc-list-item__start-detail">power_settings_new</i>
                        <span>退出</span>
                    </a>
                </div>
            </div>
        </section>
    </header>

    <!-- 工作区 -->
    <main class="pt-main" role="main">
        <div class="search-panel">
            <input type="hidden" id="list-page-index" value="1" />
            <input type="hidden" id="list-order-name" value="name" />
            <input type="hidden" id="list-order-direction" value="asc" />

            <div class="pt-fields pt-fields-horiz">
                <div class="pt-field">
                    <label>
                        <input type="text" id="list-name" placeholder="名称/编号/手机/邮箱" maxlength="50" autocomplete="off" />
                    </label>
                </div>
            </div>

            <button id="search" class="mdc-ripple-surface mdc-ripple-surface--primary mdc-theme--primary" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                <i class="material-icons">search</i>
            </button>
        </div>

        <article class="pt-row">
            <header>
                <div class="pt-row-icon"></div>
                <div class="pt-row-info">
                    <div>
                        <a class="pt-order-field" data-order-name="name" data-order-direction="asc">
                            <label>名称</label>
                            <i class="material-icons">arrow_drop_down</i>
                        </a>
                    </div>
                    <div class="w-5 hidden-phone">
                        <a class="pt-order-field" data-order-name="no" data-order-direction="asc">
                            <label>编号</label>
                            <i class="material-icons">arrow_drop_down</i>
                        </a>
                    </div>
                    <div class="w-7 hidden-phone hidden-tablet">
                        <a class="pt-order-field" data-order-name="mobile" data-order-direction="asc">
                            <label>手机号码</label>
                            <i class="material-icons">arrow_drop_down</i>
                        </a>
                    </div>
                    <div class="w-13 hidden-phone hidden-tablet">
                        <a class="pt-order-field" data-order-name="email" data-order-direction="asc">
                            <label>电子邮箱</label>
                            <i class="material-icons">arrow_drop_down</i>
                        </a>
                    </div>
                    <div class="w-9 hidden-phone hidden-tablet">
                        <a class="pt-order-field" data-order-name="createtime" data-order-direction="asc">
                            <label>注册日期</label>
                            <i class="material-icons">arrow_drop_down</i>
                        </a>
                    </div>
                </div>
                <div class="pt-row-more">
                    <i></i>
                </div>
            </header>
            <section class="mdc-elevation--z1" id="users"></section>
        </article>

        <div id="loaded-summary">
            <div><span id="loaded-rows">0</span><span id="total-rows">0</span></div>
            <button id="load-more" class="mdc-ripple-surface mdc-ripple-surface--primary mdc-theme--primary" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                <i class="material-icons">more_horiz</i>
            </button>
        </div>
    </main>

    <!-- 对话框与菜单 -->
    <div class="pt-menus-dialogs">
        <!-- 用户菜单 -->
        <div id="model-user-menu" class="mdc-simple-menu mdc-simple-menu--open-from-top-right" tabindex="-1">
            <ul class="mdc-simple-menu__items mdc-list mdc-elevation--z9" role="menu" aria-hidden="true">
                <li class="mdc-list-item" role="menuitem" tabindex="0" data-target-dialog="#apps-dialog">
                    <i class="material-icons mdc-list-item__start-detail">security</i>
                    <span>权限</span>
                </li>
                <li class="mdc-list-divider" role="separator"></li>
                <li class="mdc-list-item" role="menuitem" tabindex="0" data-target-dialog="#edit-dialog">
                    <i class="material-icons mdc-list-item__start-detail">mode_edit</i>
                    <span>设置资料</span>
                </li>
                <li class="mdc-list-item" role="menuitem" tabindex="0" data-target-dialog="#set-password-dialog">
                    <i class="material-icons mdc-list-item__start-detail">vpn_key</i>
                    <span>设置密码</span>
                </li>
                <li class="mdc-list-item hidden-phone hidden-tablet" role="menuitem" tabindex="0" data-target-dialog="#set-face-dialog">
                    <i class="material-icons mdc-list-item__start-detail">account_circle</i>
                    <span>设置头像</span>
                </li>
                <li class="mdc-list-divider" role="separator"></li>
                <li class="mdc-list-item" role="menuitem" tabindex="0">
                    <i class="material-icons mdc-list-item__start-detail">lock_outline</i>
                    <span>锁定</span>
                </li>
                <li class="mdc-list-divider" role="separator"></li>
                <li class="mdc-list-item" role="menuitem" tabindex="0">
                    <i class="material-icons mdc-list-item__start-detail">delete_forever</i>
                    <span>删除</span>
                </li>
            </ul>
        </div>
        
        <!-- 添加新用户对话框 -->
        <div class="mdc-dialog small-dialog" id="add-dialog">
            <article class="mdc-dialog__surface">
                <header class="mdc-dialog__header">
                    <h2 class="mdc-dialog__header__title" id="add-dialog-title">新用户</h2>
                </header>
                <section class="mdc-dialog__body mdc-dialog__body--scrollable" id="add-dialog-body">
                    <div class="pt-fields">
                        <div class="pt-field required">
                            <label>
                                <b>登录名称</b>
                                <input type="text" id="add-login-name" maxlength="50" required autocomplete="off" />
                            </label>
                        </div>
                        <div class="pt-field required">
                            <label>
                                <b>登录密码</b>
                                <input type="text" id="add-password" maxlength="30" required autocomplete="off" placeholder="最少 6 个字符" />
                            </label>
                        </div>
                        <div class="pt-field">
                            <label>
                                <b>用户名称</b>
                                <input type="text" id="add-name" maxlength="50" autocomplete="off" />
                            </label>
                        </div>
                        <div class="pt-field">
                            <label>
                                <b>用户编号</b>
                                <input type="text" id="add-no" maxlength="20" autocomplete="off" />
                            </label>
                        </div>
                        <div class="pt-field">
                            <label>
                                <b>手机号码</b>
                                <input type="text" id="add-mobile" maxlength="20" autocomplete="off" />
                            </label>
                        </div>
                        <div class="pt-field">
                            <label>
                                <b>电子邮箱</b>
                                <input type="email" id="add-email" maxlength="50" autocomplete="off" />
                            </label>
                        </div>
                        <div class="pt-field">
                            <label>
                                <b>个人首页</b>
                                <input type="email" id="add-login-home-url" maxlength="200" autocomplete="off" />
                            </label>
                        </div>
                    </div>
                </section>
                <footer class="mdc-dialog__footer">
                    <a class="pt-dialog-footer-help" href="help/index.html#add" target="_blank">
                        <i class="material-icons">help_outline</i>
                    </a>
                    <div></div>
                    <button type="button" class="mdc-button mdc-dialog__footer__button" data-cancel>取消</button>
                    <button type="button" class="mdc-button mdc-dialog__footer__button mdc-button--primary" data-ok>确定</button>
                </footer>
            </article>
            <div class="mdc-dialog__backdrop"></div>
        </div>

        <!-- 设置资料对话框 -->
        <div class="mdc-dialog small-dialog" id="edit-dialog">
            <article class="mdc-dialog__surface">
                <section class="mdc-dialog__body mdc-dialog__body--scrollable" id="edit-dialog-body">
                    <div class="pt-fields">
                        <div class="pt-field required">
                            <label>
                                <b>登录名称</b>
                                <input type="text" id="edit-login-name" maxlength="50" required autocomplete="off" />
                            </label>
                        </div>
                        <div class="pt-field">
                            <label>
                                <b>用户名称</b>
                                <input type="text" id="edit-name" maxlength="50" autocomplete="off" />
                            </label>
                        </div>
                        <div class="pt-field">
                            <label>
                                <b>用户编号</b>
                                <input type="text" id="edit-no" maxlength="20" autocomplete="off" />
                            </label>
                        </div>
                        <div class="pt-field">
                            <label>
                                <b>手机号码</b>
                                <input type="text" id="edit-mobile" maxlength="20" autocomplete="off" />
                            </label>
                        </div>
                        <div class="pt-field">
                            <label>
                                <b>电子邮箱</b>
                                <input type="email" id="edit-email" maxlength="50" autocomplete="off" />
                            </label>
                        </div>
                        <div class="pt-field">
                            <label>
                                <b>个人首页</b>
                                <input type="email" id="edit-login-home-url" maxlength="200" autocomplete="off" />
                            </label>
                        </div>
                    </div>
                </section>
                <footer class="mdc-dialog__footer">
                    <a class="pt-dialog-footer-help" href="help/index.html#edit" target="_blank">
                        <i class="material-icons">help_outline</i>
                    </a>
                    <div></div>
                    <button type="button" class="mdc-button mdc-dialog__footer__button" data-cancel>取消</button>
                    <button type="button" class="mdc-button mdc-dialog__footer__button mdc-button--primary" data-ok>确定</button>
                </footer>
            </article>
            <div class="mdc-dialog__backdrop"></div>
        </div>

        <!-- 设置密码对话框 -->
        <div class="mdc-dialog small-dialog" id="set-password-dialog">
            <article class="mdc-dialog__surface">
                <header class="mdc-dialog__header">
                    <h2 class="mdc-dialog__header__title" id="set-password-dialog-title">设置密码</h2>
                </header>
                <section class="mdc-dialog__body mdc-dialog__body--scrollable" id="set-password-dialog-body">
                    <div class="pt-fields">
                        <div class="pt-field required">
                            <label>
                                <input type="text" id="set-password-password" maxlength="30" required autocomplete="off" placeholder="新登录密码" />
                            </label>
                        </div>
                    </div>
                </section>
                <footer class="mdc-dialog__footer">
                    <a class="pt-dialog-footer-help" href="help/index.html#set-password" target="_blank">
                        <i class="material-icons">help_outline</i>
                    </a>
                    <div></div>
                    <button type="button" class="mdc-button mdc-dialog__footer__button" data-cancel>取消</button>
                    <button type="button" class="mdc-button mdc-dialog__footer__button mdc-button--primary" data-ok>确定</button>
                </footer>
            </article>
            <div class="mdc-dialog__backdrop"></div>
        </div>

        <!-- 设置头像对话框 -->
        <div class="mdc-dialog small-dialog" id="set-face-dialog">
            <article class="mdc-dialog__surface">
                <header class="mdc-dialog__header">
                    <h2 class="mdc-dialog__header__title" id="set-face-dialog-title">设置头像</h2>
                </header>
                <section class="mdc-dialog__body mdc-dialog__body--scrollable" id="set-face-dialog-body">
                    <header>
                        <img id="set-face-thumb" src="" alt="" />
                    </header>
                    <div>
                        <button class="mdc-button mdc-button--primary" type="button" id="set-face-select-file" autocomplete="off">选择图片</button>
                        <input type="file" id="set-face-file" accept=".bmp,.svg,.png,.jpg,.jpeg,.gif" style="display:none" autocomplete="off" />
                    </div>
                    <div class="mdc-linear-progress mdc-linear-progress--accent" id="set-face-progress" role="progressbar">
                        <div class="mdc-linear-progress__buffering-dots"></div>
                        <div class="mdc-linear-progress__buffer"></div>
                        <div class="mdc-linear-progress__bar mdc-linear-progress__primary-bar">
                            <span class="mdc-linear-progress__bar-inner"></span>
                        </div>
                        <div class="mdc-linear-progress__bar mdc-linear-progress__secondary-bar">
                            <span class="mdc-linear-progress__bar-inner"></span>
                        </div>
                    </div>
                </section>
                <footer class="mdc-dialog__footer">
                    <a class="pt-dialog-footer-help" href="help/index.html#set-face" target="_blank">
                        <i class="material-icons">help_outline</i>
                    </a>
                    <div></div>
                    <button type="button" class="mdc-button mdc-dialog__footer__button" data-cancel>取消</button>
                    <button type="button" class="mdc-button mdc-dialog__footer__button mdc-button--primary" disabled data-ok>上传并设置</button>
                </footer>
            </article>
            <div class="mdc-dialog__backdrop"></div>
        </div>

        <!-- 权限对话框 -->
        <div class="mdc-dialog" id="apps-dialog">
            <article class="mdc-dialog__surface">
                <header class="mdc-dialog__header">
                    <h2 class="mdc-dialog__header__title" id="apps-dialog-title">设置权限</h2>
                </header>
                <section class="mdc-dialog__body mdc-dialog__body--scrollable" id="apps-dialog-body">
                    <article class="pt-row">
                        <section id="apps"></section>
                    </article>
                </section>
                <footer class="mdc-dialog__footer">
                    <a class="pt-dialog-footer-help" href="help/index.html#apps" target="_blank">
                        <i class="material-icons">help_outline</i>
                    </a>
                    <div></div>
                    <button type="button" class="mdc-button mdc-dialog__footer__button" data-cancel>关闭</button>
                </footer>
            </article>
            <div class="mdc-dialog__backdrop"></div>
        </div>
    </div>

    <!-- 导航列表 -->
    <nav class="pt-nav">
        <article class="pt-nav-panel">
            <header>
                <div class="pt-nav-toolbar">
                    <a class="mdc-ripple-surface" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple" href="../../../../index.html" title="返回首页">
                        <i class="material-icons">home</i>
                    </a>
                    <a class="pt-nav-refresh mdc-ripple-surface" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple" title="刷新导航">
                        <i class="material-icons">update</i>
                    </a>
                    <a class="pt-nav-pin mdc-ripple-surface" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple" title="取消固定导航">
                        <i class="material-icons">call_received</i>
                    </a>
                </div>
                <div class="pt-nav-userbar">
                    <a href="../../../waln/authority/profile/index.html">
                        <i class="material-icons">account_circle</i>
                        <b>未登录</b>
                    </a>
                </div>
            </header>
            <section></section>
        </article>
        <!-- 导航列表的背景，不要移除该元素 -->
        <div></div>
    </nav>

    <!-- 通知中心 -->
    <aside class="pt-nc">
        <article class="pt-nc-panel">
            <header>
                <a class="pt-nc-close mdc-ripple-surface" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple" data-nc-close>
                    <i class="material-icons">close</i>
                </a>
                <h1>通知中心</h1>
                <a class="mdc-ripple-surface" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple" href="../../../waln/notifying/inbox/list.html" title="所有已接收">
                    <i class="material-icons">inbox</i>
                </a>
            </header>
            <section></section>
        </article>
        <!-- 通知中心的背景，不要移除该元素 -->
        <div></div>
    </aside>

    <script src="../../../../js/jquery.min.js"></script>
    <script src="../../../../mdc/material-components-web.min.js"></script>
    <script src="../../../../js/pittypat.js"></script>
    <script src="_api.js"></script>
    <script src="list.js"></script>
</body>
</html>